<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="dialogflow_v2.html">Dialogflow API</a> . <a href="dialogflow_v2.projects.html">projects</a> . <a href="dialogflow_v2.projects.locations.html">locations</a> . <a href="dialogflow_v2.projects.locations.conversations.html">conversations</a> . <a href="dialogflow_v2.projects.locations.conversations.suggestions.html">suggestions</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#generate">generate(conversation, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Generates all the suggestions using generators configured in the conversation profile. A generator is used only if its trigger event is matched.</p>
<p class="toc_element">
  <code><a href="#searchKnowledge">searchKnowledge(conversation, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Get answers for the given query based on knowledge documents.</p>
<p class="toc_element">
  <code><a href="#suggestConversationSummary">suggestConversationSummary(conversation, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Suggests summary for a conversation based on specific historical messages. The range of the messages to be used for summary can be specified in the request.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="generate">generate(conversation, body=None, x__xgafv=None)</code>
  <pre>Generates all the suggestions using generators configured in the conversation profile. A generator is used only if its trigger event is matched.

Args:
  conversation: string, Required. The conversation for which the suggestions are generated. Format: `projects//locations//conversations/`. The conversation must be created with a conversation profile which has generators configured in it to be able to get suggestions. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.GenerateSuggestions.
  &quot;latestMessage&quot;: &quot;A String&quot;, # Optional. The name of the latest conversation message for which the request is triggered. Format: `projects//locations//conversations//messages/`.
  &quot;triggerEvents&quot;: [ # Optional. A list of trigger events. Only generators configured in the conversation_profile whose trigger_event is listed here will be triggered.
    &quot;A String&quot;,
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response message for Conversations.GenerateSuggestions.
  &quot;generatorSuggestionAnswers&quot;: [ # The answers generated for the conversation based on context.
    { # A GeneratorSuggestion answer.
      &quot;answerRecord&quot;: &quot;A String&quot;, # Answer record that uniquely identifies the suggestion. This can be used to provide suggestion feedback.
      &quot;generatorSuggestion&quot;: { # Suggestion generated using a Generator. # Suggestion details.
        &quot;agentCoachingSuggestion&quot;: { # Suggestion for coaching agents. # Optional. Suggestion to coach the agent.
          &quot;agentActionSuggestions&quot;: [ # Optional. Suggested actions for the agent to take.
            { # Actions suggested for the agent. This is based on applicable instructions.
              &quot;agentAction&quot;: &quot;A String&quot;, # Optional. The suggested action for the agent.
              &quot;duplicateCheckResult&quot;: { # Duplication check for the suggestion. # Output only. Duplicate check result for the agent action suggestion.
                &quot;duplicateSuggestions&quot;: [ # Output only. The duplicate suggestions.
                  { # The duplicate suggestion details. Keeping answer_record and sources together as they are identifiers for duplicate suggestions.
                    &quot;answerRecord&quot;: &quot;A String&quot;, # Output only. The answer record id of the past duplicate suggestion.
                    &quot;similarityScore&quot;: 3.14, # Output only. The similarity score of between the past and current suggestion.
                    &quot;sources&quot;: { # Sources for the suggestion. # Output only. Sources for the suggestion.
                      &quot;instructionIndexes&quot;: [ # Output only. Source instruction indexes for the suggestion. This is the index of the applicable_instructions field.
                        42,
                      ],
                    },
                    &quot;suggestionIndex&quot;: 42, # Output only. The index of the duplicate suggestion in the past suggestion list.
                  },
                ],
              },
              &quot;sources&quot;: { # Sources for the suggestion. # Output only. Sources for the agent action suggestion.
                &quot;instructionIndexes&quot;: [ # Output only. Source instruction indexes for the suggestion. This is the index of the applicable_instructions field.
                  42,
                ],
              },
            },
          ],
          &quot;applicableInstructions&quot;: [ # Optional. Instructions applicable based on the current context.
            { # Agent Coaching instructions that customer can configure.
              &quot;agentAction&quot;: &quot;A String&quot;, # Optional. The action that human agent should take. For example, &quot;apologize for the slow shipping&quot;. If the users only want to use agent coaching for intent detection, agent_action can be empty
              &quot;condition&quot;: &quot;A String&quot;, # Optional. The condition of the instruction. For example, &quot;the customer wants to cancel an order&quot;. If the users want the instruction to be triggered unconditionally, the condition can be empty.
              &quot;displayDetails&quot;: &quot;A String&quot;, # Optional. The detailed description of this instruction.
              &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name for the instruction.
              &quot;duplicateCheckResult&quot;: { # Duplication check for the suggestion. # Output only. Duplication check for the AgentCoachingInstruction.
                &quot;duplicateSuggestions&quot;: [ # Output only. The duplicate suggestions.
                  { # The duplicate suggestion details.
                    &quot;answerRecord&quot;: &quot;A String&quot;, # Output only. The answer record id of the past duplicate suggestion.
                    &quot;similarityScore&quot;: 3.14, # Output only. The similarity score of between the past and current suggestion.
                    &quot;suggestionIndex&quot;: 42, # Output only. The index of the duplicate suggestion in the past suggestion list.
                  },
                ],
              },
              &quot;systemAction&quot;: &quot;A String&quot;, # Optional. The action that system should take. For example, &quot;call GetOrderTime with order_number={order number provided by the customer}&quot;. If the users don&#x27;t have plugins or don&#x27;t want to trigger plugins, the system_action can be empty
            },
          ],
          &quot;sampleResponses&quot;: [ # Optional. Sample response for the Agent.
            { # Sample response that the agent can use. This could be based on applicable instructions and ingested data from other systems.
              &quot;duplicateCheckResult&quot;: { # Duplication check for the suggestion. # Output only. Duplicate check result for the sample response.
                &quot;duplicateSuggestions&quot;: [ # Output only. The duplicate suggestions.
                  { # The duplicate suggestion details. Keeping answer_record and sources together as they are identifiers for duplicate suggestions.
                    &quot;answerRecord&quot;: &quot;A String&quot;, # Output only. The answer record id of the past duplicate suggestion.
                    &quot;similarityScore&quot;: 3.14, # Output only. The similarity score of between the past and current suggestion.
                    &quot;sources&quot;: { # Sources for the suggestion. # Output only. Sources for the suggestion.
                      &quot;instructionIndexes&quot;: [ # Output only. Source instruction indexes for the suggestion. This is the index of the applicable_instructions field.
                        42,
                      ],
                    },
                    &quot;suggestionIndex&quot;: 42, # Output only. The index of the duplicate suggestion in the past suggestion list.
                  },
                ],
              },
              &quot;responseText&quot;: &quot;A String&quot;, # Optional. Sample response for Agent in text.
              &quot;sources&quot;: { # Sources for the suggestion. # Output only. Sources for the Sample Response.
                &quot;instructionIndexes&quot;: [ # Output only. Source instruction indexes for the suggestion. This is the index of the applicable_instructions field.
                  42,
                ],
              },
            },
          ],
        },
        &quot;freeFormSuggestion&quot;: { # Suggestion generated using free form generator. # Optional. Free form suggestion.
          &quot;response&quot;: &quot;A String&quot;, # Required. Free form suggestion.
        },
        &quot;summarySuggestion&quot;: { # Suggested summary of the conversation. # Optional. Suggested summary.
          &quot;summarySections&quot;: [ # Required. All the parts of generated summary.
            { # A component of the generated summary.
              &quot;section&quot;: &quot;A String&quot;, # Required. Name of the section.
              &quot;summary&quot;: &quot;A String&quot;, # Required. Summary text for the section.
            },
          ],
        },
        &quot;toolCallInfo&quot;: [ # Optional. List of request and response for tool calls executed.
          { # Request and response for a tool call.
            &quot;toolCall&quot;: { # Represents a call of a specific tool&#x27;s action with the specified inputs. # Required. Request for a tool call.
              &quot;action&quot;: &quot;A String&quot;, # Optional. The name of the tool&#x27;s action associated with this call.
              &quot;answerRecord&quot;: &quot;A String&quot;, # Optional. The answer record associated with this tool call.
              &quot;createTime&quot;: &quot;A String&quot;, # Output only. Create time of the tool call.
              &quot;inputParameters&quot;: { # Optional. The action&#x27;s input parameters.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
              &quot;state&quot;: &quot;A String&quot;, # Output only. State of the tool call.
              &quot;tool&quot;: &quot;A String&quot;, # Optional. The tool associated with this call. Format: `projects//locations//tools/`.
              &quot;toolDisplayDetails&quot;: &quot;A String&quot;, # Optional. A human readable description of the tool.
              &quot;toolDisplayName&quot;: &quot;A String&quot;, # Optional. A human readable short name of the tool, to be shown on the UI.
            },
            &quot;toolCallResult&quot;: { # The result of calling a tool&#x27;s action. # Required. Response for a tool call.
              &quot;action&quot;: &quot;A String&quot;, # Optional. The name of the tool&#x27;s action associated with this call.
              &quot;answerRecord&quot;: &quot;A String&quot;, # Optional. The answer record associated with this tool call result.
              &quot;content&quot;: &quot;A String&quot;, # Only populated if the response content is utf-8 encoded.
              &quot;createTime&quot;: &quot;A String&quot;, # Output only. Create time of the tool call result.
              &quot;error&quot;: { # An error produced by the tool call. # The tool call&#x27;s error.
                &quot;message&quot;: &quot;A String&quot;, # Optional. The error message of the function.
              },
              &quot;rawContent&quot;: &quot;A String&quot;, # Only populated if the response content is not utf-8 encoded. (by definition byte fields are base64 encoded).
              &quot;tool&quot;: &quot;A String&quot;, # Optional. The tool associated with this call. Format: `projects//locations//tools/`.
            },
          },
        ],
      },
      &quot;sourceGenerator&quot;: &quot;A String&quot;, # The name of the generator used to generate this suggestion. Format: `projects//locations//generators/`.
    },
  ],
  &quot;latestMessage&quot;: &quot;A String&quot;, # The name of the latest conversation message used as context for compiling suggestion. Format: `projects//locations//conversations//messages/`.
}</pre>
</div>

<div class="method">
    <code class="details" id="searchKnowledge">searchKnowledge(conversation, body=None, x__xgafv=None)</code>
  <pre>Get answers for the given query based on knowledge documents.

Args:
  conversation: string, Optional. The conversation (between human agent and end user) where the search request is triggered. Format: `projects//locations//conversations/`. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.SearchKnowledge.
  &quot;conversation&quot;: &quot;A String&quot;, # Optional. The conversation (between human agent and end user) where the search request is triggered. Format: `projects//locations//conversations/`.
  &quot;conversationProfile&quot;: &quot;A String&quot;, # Required. The conversation profile used to configure the search. Format: `projects//locations//conversationProfiles/`.
  &quot;endUserMetadata&quot;: { # Optional. Information about the end-user to improve the relevance and accuracy of generative answers. This will be interpreted and used by a language model, so, for good results, the data should be self-descriptive, and in a simple structure. Example: ```json { &quot;subscription plan&quot;: &quot;Business Premium Plus&quot;, &quot;devices owned&quot;: [ {&quot;model&quot;: &quot;Google Pixel 7&quot;}, {&quot;model&quot;: &quot;Google Pixel Tablet&quot;} ] } ```
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
  },
  &quot;exactSearch&quot;: True or False, # Optional. Whether to search the query exactly without query rewrite.
  &quot;latestMessage&quot;: &quot;A String&quot;, # Optional. The name of the latest conversation message when the request is triggered. Format: `projects//locations//conversations//messages/`.
  &quot;parent&quot;: &quot;A String&quot;, # Required. The parent resource contains the conversation profile Format: &#x27;projects/&#x27; or `projects//locations/`.
  &quot;query&quot;: { # Auxiliary proto messages. Represents the natural language text to be processed. # Required. The natural language text query for knowledge search.
    &quot;languageCode&quot;: &quot;A String&quot;, # Required. The language of this conversational query. See [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) for a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language.
    &quot;text&quot;: &quot;A String&quot;, # Required. The UTF-8 encoded natural language text to be processed. Text length must not exceed 256 characters for virtual agent interactions.
  },
  &quot;querySource&quot;: &quot;A String&quot;, # Optional. The source of the query in the request.
  &quot;searchConfig&quot;: { # Configuration specific to search queries with data stores. # Optional. Configuration specific to search queries with data stores.
    &quot;boostSpecs&quot;: [ # Optional. Boost specifications for data stores. Maps from datastore name to their boost configuration. Do not specify more than one BoostSpecs for each datastore name. If multiple BoostSpecs are provided for the same datastore name, the behavior is undefined.
      { # Boost specifications for data stores.
        &quot;dataStores&quot;: [ # Optional. Data Stores where the boosting configuration is applied. The full names of the referenced data stores. Formats: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` `projects/{project}/locations/{location}/dataStores/{data_store}`
          &quot;A String&quot;,
        ],
        &quot;spec&quot;: [ # Optional. A list of boosting specifications.
          { # Boost specification to boost certain documents. A copy of google.cloud.discoveryengine.v1main.BoostSpec, field documentation is available at https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec
            &quot;conditionBoostSpecs&quot;: [ # Optional. Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
              { # Boost applies to documents which match a condition.
                &quot;boost&quot;: 3.14, # Optional. Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored.
                &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Optional. Complex specification for custom ranking based on customer defined attribute value.
                  &quot;attributeType&quot;: &quot;A String&quot;, # Optional. The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
                  &quot;controlPoints&quot;: [ # Optional. The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                    { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                      &quot;attributeValue&quot;: &quot;A String&quot;, # Optional. Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                      &quot;boostAmount&quot;: 3.14, # Optional. The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                    },
                  ],
                  &quot;fieldName&quot;: &quot;A String&quot;, # Optional. The name of the field whose value will be used to determine the boost amount.
                  &quot;interpolationType&quot;: &quot;A String&quot;, # Optional. The interpolation type to be applied to connect the control points listed below.
                },
                &quot;condition&quot;: &quot;A String&quot;, # Optional. An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: * (id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;,&quot;Blue&quot;))
              },
            ],
          },
        ],
      },
    ],
    &quot;filterSpecs&quot;: [ # Optional. Filter specification for data store queries. TMaps from datastore name to the filter expression for that datastore. Do not specify more than one FilterSpecs for each datastore name. If multiple FilterSpecs are provided for the same datastore name, the behavior is undefined.
      { # Filter specification for data store queries.
        &quot;dataStores&quot;: [ # Optional. The data store where the filter configuration is applied. Full resource name of data store, such as projects/{project}/locations/{location}/collections/{collectionId}/ dataStores/{dataStoreId}.
          &quot;A String&quot;,
        ],
        &quot;filter&quot;: &quot;A String&quot;, # Optional. The filter expression to be applied. Expression syntax is documented at https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax
      },
    ],
  },
  &quot;sessionId&quot;: &quot;A String&quot;, # Required. The ID of the search session. The session_id can be combined with Dialogflow V3 Agent ID retrieved from conversation profile or on its own to identify a search session. The search history of the same session will impact the search result. It&#x27;s up to the API caller to choose an appropriate `Session ID`. It can be a random number or some type of session identifiers (preferably hashed). The length must not exceed 36 characters.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response message for Conversations.SearchKnowledge.
  &quot;answers&quot;: [ # Most relevant snippets extracted from articles in the given knowledge base, ordered by confidence.
    { # Represents a SearchKnowledge answer.
      &quot;answer&quot;: &quot;A String&quot;, # The piece of text from the knowledge base documents that answers the search query
      &quot;answerRecord&quot;: &quot;A String&quot;, # The name of the answer record. Format: `projects//locations//answer Records/`
      &quot;answerSources&quot;: [ # All sources used to generate the answer.
        { # The sources of the answers.
          &quot;metadata&quot;: { # Metadata associated with the article.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;snippet&quot;: &quot;A String&quot;, # The relevant snippet of the article.
          &quot;title&quot;: &quot;A String&quot;, # The title of the article.
          &quot;uri&quot;: &quot;A String&quot;, # The URI of the article.
        },
      ],
      &quot;answerType&quot;: &quot;A String&quot;, # The type of the answer.
    },
  ],
  &quot;rewrittenQuery&quot;: &quot;A String&quot;, # The rewritten query used to search knowledge.
}</pre>
</div>

<div class="method">
    <code class="details" id="suggestConversationSummary">suggestConversationSummary(conversation, body=None, x__xgafv=None)</code>
  <pre>Suggests summary for a conversation based on specific historical messages. The range of the messages to be used for summary can be specified in the request.

Args:
  conversation: string, Required. The conversation to fetch suggestion for. Format: `projects//locations//conversations/`. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.SuggestConversationSummary.
  &quot;assistQueryParams&quot;: { # Represents the parameters of human assist query. # Optional. Parameters for a human assist query. Only used for POC/demo purpose.
    &quot;documentsMetadataFilters&quot;: { # Key-value filters on the metadata of documents returned by article suggestion. If specified, article suggestion only returns suggested documents that match all filters in their Document.metadata. Multiple values for a metadata key should be concatenated by comma. For example, filters to match all documents that have &#x27;US&#x27; or &#x27;CA&#x27; in their market metadata values and &#x27;agent&#x27; in their user metadata values will be ``` documents_metadata_filters { key: &quot;market&quot; value: &quot;US,CA&quot; } documents_metadata_filters { key: &quot;user&quot; value: &quot;agent&quot; } ```
      &quot;a_key&quot;: &quot;A String&quot;,
    },
  },
  &quot;contextSize&quot;: 42, # Optional. Max number of messages prior to and including [latest_message] to use as context when compiling the suggestion. By default 500 and at most 1000.
  &quot;latestMessage&quot;: &quot;A String&quot;, # Optional. The name of the latest conversation message used as context for compiling suggestion. If empty, the latest message of the conversation will be used. Format: `projects//locations//conversations//messages/`.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response message for Conversations.SuggestConversationSummary.
  &quot;contextSize&quot;: 42, # Number of messages prior to and including latest_message used to compile the suggestion. It may be smaller than the SuggestConversationSummaryRequest.context_size field in the request if there weren&#x27;t that many messages in the conversation.
  &quot;latestMessage&quot;: &quot;A String&quot;, # The name of the latest conversation message used as context for compiling suggestion. Format: `projects//locations//conversations//messages/`.
  &quot;summary&quot;: { # Generated summary for a conversation. # Generated summary.
    &quot;answerRecord&quot;: &quot;A String&quot;, # The name of the answer record. Format: &quot;projects//answerRecords/&quot;
    &quot;baselineModelVersion&quot;: &quot;A String&quot;, # The baseline model version used to generate this summary. It is empty if a baseline model was not used to generate this summary.
    &quot;text&quot;: &quot;A String&quot;, # The summary content that is concatenated into one string.
    &quot;textSections&quot;: { # The summary content that is divided into sections. The key is the section&#x27;s name and the value is the section&#x27;s content. There is no specific format for the key or value.
      &quot;a_key&quot;: &quot;A String&quot;,
    },
  },
}</pre>
</div>

</body></html>